Optimal. Leaf size=107 \[ \frac {1}{2} \left (2 a^2 c+b^2 c+2 a b d\right ) x-\frac {2 \left (3 a b c+a^2 d+b^2 d\right ) \cos (e+f x)}{3 f}-\frac {b (3 b c+2 a d) \cos (e+f x) \sin (e+f x)}{6 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^2}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2832, 2813}
\begin {gather*} -\frac {2 \left (a^2 d+3 a b c+b^2 d\right ) \cos (e+f x)}{3 f}+\frac {1}{2} x \left (2 a^2 c+2 a b d+b^2 c\right )-\frac {b (2 a d+3 b c) \sin (e+f x) \cos (e+f x)}{6 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^2}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2832
Rubi steps
\begin {align*} \int (a+b \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx &=-\frac {d \cos (e+f x) (a+b \sin (e+f x))^2}{3 f}+\frac {1}{3} \int (a+b \sin (e+f x)) (3 a c+2 b d+(3 b c+2 a d) \sin (e+f x)) \, dx\\ &=\frac {1}{2} \left (2 a^2 c+b^2 c+2 a b d\right ) x-\frac {2 \left (3 a b c+a^2 d+b^2 d\right ) \cos (e+f x)}{3 f}-\frac {b (3 b c+2 a d) \cos (e+f x) \sin (e+f x)}{6 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 90, normalized size = 0.84 \begin {gather*} \frac {6 \left (2 a^2 c+b^2 c+2 a b d\right ) (e+f x)-3 \left (8 a b c+4 a^2 d+3 b^2 d\right ) \cos (e+f x)+b^2 d \cos (3 (e+f x))-3 b (b c+2 a d) \sin (2 (e+f x))}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 115, normalized size = 1.07
method | result | size |
derivativedivides | \(\frac {a^{2} c \left (f x +e \right )-a^{2} d \cos \left (f x +e \right )-2 a b c \cos \left (f x +e \right )+2 a b d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b^{2} c \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(115\) |
default | \(\frac {a^{2} c \left (f x +e \right )-a^{2} d \cos \left (f x +e \right )-2 a b c \cos \left (f x +e \right )+2 a b d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b^{2} c \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(115\) |
risch | \(a^{2} c x +x a b d +\frac {x \,b^{2} c}{2}-\frac {\cos \left (f x +e \right ) a^{2} d}{f}-\frac {2 \cos \left (f x +e \right ) a b c}{f}-\frac {3 \cos \left (f x +e \right ) b^{2} d}{4 f}+\frac {b^{2} d \cos \left (3 f x +3 e \right )}{12 f}-\frac {\sin \left (2 f x +2 e \right ) a b d}{2 f}-\frac {\sin \left (2 f x +2 e \right ) b^{2} c}{4 f}\) | \(117\) |
norman | \(\frac {\left (a^{2} c +a b d +\frac {1}{2} b^{2} c \right ) x +\left (a^{2} c +a b d +\frac {1}{2} b^{2} c \right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (3 a^{2} c +3 a b d +\frac {3}{2} b^{2} c \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (3 a^{2} c +3 a b d +\frac {3}{2} b^{2} c \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {b \left (2 a d +b c \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {6 a^{2} d +12 a b c +4 b^{2} d}{3 f}-\frac {\left (2 a^{2} d +4 a b c \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (4 a^{2} d +8 a b c +4 b^{2} d \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {b \left (2 a d +b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}\) | \(259\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 121, normalized size = 1.13 \begin {gather*} \frac {12 \, {\left (f x + e\right )} a^{2} c + 3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c + 6 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b d + 4 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} d - 24 \, a b c \cos \left (f x + e\right ) - 12 \, a^{2} d \cos \left (f x + e\right )}{12 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 93, normalized size = 0.87 \begin {gather*} \frac {2 \, b^{2} d \cos \left (f x + e\right )^{3} + 3 \, {\left (2 \, a b d + {\left (2 \, a^{2} + b^{2}\right )} c\right )} f x - 3 \, {\left (b^{2} c + 2 \, a b d\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 6 \, {\left (2 \, a b c + {\left (a^{2} + b^{2}\right )} d\right )} \cos \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.15, size = 199, normalized size = 1.86 \begin {gather*} \begin {cases} a^{2} c x - \frac {a^{2} d \cos {\left (e + f x \right )}}{f} - \frac {2 a b c \cos {\left (e + f x \right )}}{f} + a b d x \sin ^{2}{\left (e + f x \right )} + a b d x \cos ^{2}{\left (e + f x \right )} - \frac {a b d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} + \frac {b^{2} c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {b^{2} d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{2} d \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{2} \left (c + d \sin {\left (e \right )}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 96, normalized size = 0.90 \begin {gather*} \frac {b^{2} d \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} + \frac {1}{2} \, {\left (2 \, a^{2} c + b^{2} c + 2 \, a b d\right )} x - \frac {{\left (8 \, a b c + 4 \, a^{2} d + 3 \, b^{2} d\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (b^{2} c + 2 \, a b d\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.77, size = 108, normalized size = 1.01 \begin {gather*} -\frac {\frac {3\,b^2\,c\,\sin \left (2\,e+2\,f\,x\right )}{2}-\frac {b^2\,d\,\cos \left (3\,e+3\,f\,x\right )}{2}+6\,a^2\,d\,\cos \left (e+f\,x\right )+\frac {9\,b^2\,d\,\cos \left (e+f\,x\right )}{2}+3\,a\,b\,d\,\sin \left (2\,e+2\,f\,x\right )-6\,a^2\,c\,f\,x-3\,b^2\,c\,f\,x+12\,a\,b\,c\,\cos \left (e+f\,x\right )-6\,a\,b\,d\,f\,x}{6\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________